<?php
include("include/config.inc.php");
include("include/version.inc.php");
include("include/tables.inc.php");
include("include/funktion.inc.php");



$output = $uebersicht = "";

$abfrage = "SELECT * FROM `$archivdb` ORDER BY id DESC";
$ergebnis = mysql_query($abfrage);
while($row = mysql_fetch_object($ergebnis))
   {
   $time = date("d.m.Y",$row->time);
   $id = $row->id;
   $betreff = $row->betreff;

   eval ("\$uebersicht .= \"".template("archiv_overview_row")."\";");
   }

if(!is_numeric($id = $_GET['id'])) $id = 0;

if($id == 0)
   {
   eval ("\$output = \"".template("archiv_overview")."\";");
   }
else
   {
   $abfrage = "SELECT * FROM `$archivdb` WHERE id = '$id';";
   $ergebnis = mysql_query($abfrage);
   $row = mysql_fetch_object($ergebnis);


   $time = date("d.m.Y",$row->time);
   $betreff = $row->betreff;
   ($row->modus == "html") ? $text = $row->text : $text = nl2br(htmlentities($row->text));


   eval ("\$output = \"".template("archiv_read")."\";");
   }




echo $output;
?>
